#include <stdio.h>
int calculate(long int n);
int main(void){
	int a;
	printf("请输入n来计算n！的值：");
	scanf("%d", &a);
	printf("n!=%ld", calculate(a));
	return 0;
} 

int calculate(long int n){ 
	return n == 0 ? 1 : n*calculate(n - 1);              // 用递归函数来计算阶乘 
} 
